package edu.guet.cn.blogbasics.config;

import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @Auther: hejianding
 * @Date: 2021/3/29 17:05
 * @Version: 1.0
 */
@MapperScan("edu.guet.cn.blogbasics.mapper") //包扫描
@Configuration
@EnableTransactionManagement //开启事物管理
public class MyBatisPlusConfig {
    //CRUD配置
    @Bean
    public OptimisticLockerInterceptor optimisticLockerInterceptor(){
        return new OptimisticLockerInterceptor();
    }

}
